package org.darkforest.dao.mapper;

import java.util.List;
import java.util.Map;

import org.darkforest.dao.annotation.DBMapper;
import org.darkforest.model.Message;
import org.darkforest.model.MessageSerachBean;
import org.darkforest.model.MessageVo;
@DBMapper
public interface MessageMapper {
    int deleteByPrimaryKey(Integer messageId);
    int deleteByMemberAndId(Map<String, Object> p);

    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Integer messageId);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);
    
    List<MessageVo> selectByMember(MessageSerachBean page);
    
    MessageVo selectByDetailMember(Map<String, Object> p);
    
    int selectNotReadCountByMember(Map<String, Object> map);

    /**
     * 批量插入
     * @param messages
     * @return
     */
    int batchInsert(List<Message> messages);

    /**
     * 根据用户ID查询消息
     * @param memberId
     * @return
     */
    List<Message> selectByMemberId(Integer memberId);

    /**
     * 根据条件查询
     * @param message
     * @return
     */
    List<Message> selectByCondition(Message message);
}